package com.hbnu.dao;

import com.hbnu.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {

    @Insert("insert into tb_user (name,password,address,gender,account) values(#{name},#{password},#{address},#{gender},#{account})")
    public abstract void addData(User user);


    //@Update("Update tb_user set account = #{account} where name = #{name})")
    //@Update("Update tb_user set account = #{arg0} where name = #{arg1})")
    @Update("Update tb_user set account = #{param1} where name = #{param2})")

    //void updateData(User user);

    void updateData(Double account,String name);
    //void updateData(@Param("account") Double account,@Param("name") String name);


    @Delete("delete from tb_user where id = #{id}" )
    void deleteData(int id);


    @Select("select * from tb_user where id = #{id}")
    User findById(int id);

    @Select("select * from tb_user")
    List<User> findAll();
}











